/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.util.Date;

/**
 * @author Wole Adetiba
 */
public class Supporting_DocumentClp extends BaseModelImpl<Supporting_Document>
	implements Supporting_Document {
	public Supporting_DocumentClp() {
	}

	public String getPrimaryKey() {
		return _documentId;
	}

	public void setPrimaryKey(String pk) {
		setDocumentId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _documentId;
	}

	public String getDocumentId() {
		return _documentId;
	}

	public void setDocumentId(String documentId) {
		_documentId = documentId;
	}

	public String getApplicationId() {
		return _applicationId;
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		return _userId;
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getFileName() {
		return _fileName;
	}

	public void setFileName(String fileName) {
		_fileName = fileName;
	}

	public String getDocumentName() {
		return _documentName;
	}

	public void setDocumentName(String documentName) {
		_documentName = documentName;
	}

	public String getRequired() {
		return _required;
	}

	public void setRequired(String required) {
		_required = required;
	}

	public String getDocumentType() {
		return _documentType;
	}

	public void setDocumentType(String documentType) {
		_documentType = documentType;
	}

	public String getDocumentUpload() {
		return _documentUpload;
	}

	public void setDocumentUpload(String documentUpload) {
		_documentUpload = documentUpload;
	}

	public Date getUploadedDate() {
		return _uploadedDate;
	}

	public void setUploadedDate(Date uploadedDate) {
		_uploadedDate = uploadedDate;
	}

	public Supporting_Document toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (Supporting_Document)Proxy.newProxyInstance(Supporting_Document.class.getClassLoader(),
				new Class[] { Supporting_Document.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Supporting_DocumentClp clone = new Supporting_DocumentClp();

		clone.setDocumentId(getDocumentId());
		clone.setApplicationId(getApplicationId());
		clone.setUserId(getUserId());
		clone.setFileName(getFileName());
		clone.setDocumentName(getDocumentName());
		clone.setRequired(getRequired());
		clone.setDocumentType(getDocumentType());
		clone.setDocumentUpload(getDocumentUpload());
		clone.setUploadedDate(getUploadedDate());

		return clone;
	}

	public int compareTo(Supporting_Document supporting_Document) {
		int value = 0;

		value = getDocumentId().compareTo(supporting_Document.getDocumentId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Supporting_DocumentClp supporting_Document = null;

		try {
			supporting_Document = (Supporting_DocumentClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = supporting_Document.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(19);

		sb.append("{documentId=");
		sb.append(getDocumentId());
		sb.append(", applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", fileName=");
		sb.append(getFileName());
		sb.append(", documentName=");
		sb.append(getDocumentName());
		sb.append(", required=");
		sb.append(getRequired());
		sb.append(", documentType=");
		sb.append(getDocumentType());
		sb.append(", documentUpload=");
		sb.append(getDocumentUpload());
		sb.append(", uploadedDate=");
		sb.append(getUploadedDate());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(31);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Supporting_Document");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>documentId</column-name><column-value><![CDATA[");
		sb.append(getDocumentId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fileName</column-name><column-value><![CDATA[");
		sb.append(getFileName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>documentName</column-name><column-value><![CDATA[");
		sb.append(getDocumentName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>required</column-name><column-value><![CDATA[");
		sb.append(getRequired());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>documentType</column-name><column-value><![CDATA[");
		sb.append(getDocumentType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>documentUpload</column-name><column-value><![CDATA[");
		sb.append(getDocumentUpload());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>uploadedDate</column-name><column-value><![CDATA[");
		sb.append(getUploadedDate());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _documentId;
	private String _applicationId;
	private String _userId;
	private String _fileName;
	private String _documentName;
	private String _required;
	private String _documentType;
	private String _documentUpload;
	private Date _uploadedDate;
}